package com.happyhome.datamodel;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;


/**
 * The persistent class for the room database table.
 * 
 */
@Entity
@Table(name="ROOM")
public class Room implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long idRoom;
	private String codeRoom;
	private Long depositRoom;
	private String description;
	private Integer floor;
	private String nameRoom;
	private Integer numberMaxPerson;
	private String pictures;
	private Long priceRoom;
	@Transient
	private String priceRoomValue;
	
	private Long sqft;
	private Boolean status;
	private House house;
	private Boolean isDisplay;
	private Set<RoomRental> roomRentals = new HashSet<RoomRental>();
	private Set<RoomUtility> roomUtilities = new HashSet<RoomUtility>();
	private Set<Image> images = new HashSet<Image>();
	private Date makeDate;
	@Transient
    private String url;
	@Transient
	private String address;
	@Transient
	private String homeValue;
	@Transient 
	private String googleMap;
	
	public Room() {
	}

	@Id
	@Column(name="ID_ROOM")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getIdRoom() {
		return this.idRoom;
	}

	public void setIdRoom(Long idRoom) {
		this.idRoom = idRoom;
	}


	@Column(name="CODE_ROOM")
	public String getCodeRoom() {
		return this.codeRoom;
	}

	public void setCodeRoom(String codeRoom) {
		this.codeRoom = codeRoom;
	}


	@Column(name="DEPOSIT_ROOM")
	public Long getDepositRoom() {
		return this.depositRoom;
	}

	public void setDepositRoom(Long depositRoom) {
		this.depositRoom = depositRoom;
	}

	@Column(name="DESCRIPTION")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name="FLOOR")
	public Integer getFloor() {
		return this.floor;
	}

	public void setFloor(Integer floor) {
		this.floor = floor;
	}


	@Column(name="NAME_ROOM")
	public String getNameRoom() {
		return this.nameRoom;
	}

	public void setNameRoom(String nameRoom) {
		this.nameRoom = nameRoom;
	}


	@Column(name="NUMBER_MAX_PERSON")
	public Integer getNumberMaxPerson() {
		return this.numberMaxPerson;
	}

	public void setNumberMaxPerson(Integer numberMaxPerson) {
		this.numberMaxPerson = numberMaxPerson;
	}

	@Column(name="PICTURES")
	public String getPictures() {
		return this.pictures;
	}

	public void setPictures(String pictures) {
		this.pictures = pictures;
	}


	@Column(name="PRICE_ROOM")
	public Long getPriceRoom() {
		return this.priceRoom;
	}

	public void setPriceRoom(Long priceRoom) {
		this.priceRoom = priceRoom;
	}

	@Column(name="SQFT")
	public Long getSqft() {
		return this.sqft;
	}

	public void setSqft(Long sqft) {
		this.sqft = sqft;
	}

	@Column(name="STATUS")
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}
	
	@Column(name="IS_DISPLAY")
	public Boolean getIsDisplay() {
		return isDisplay;
	}

	public void setIsDisplay(Boolean isDisplay) {
		this.isDisplay = isDisplay;
	}

	//bi-directional many-to-one association to House
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="HOUSE_ID")
	public House getHouse() {
		return this.house;
	}

	public void setHouse(House house) {
		this.house = house;
	}


	//bi-directional many-to-one association to RoomRental
	@OneToMany(mappedBy="room", fetch = FetchType.LAZY)
	public Set<RoomRental> getRoomRentals() {
		return this.roomRentals;
	}

	public void setRoomRentals(Set<RoomRental> roomRentals) {
		this.roomRentals = roomRentals;
	}

	//bi-directional many-to-one association to RoomUtility
	@OneToMany(mappedBy="room", fetch = FetchType.LAZY)
	public Set<RoomUtility> getRoomUtilities() {
		return this.roomUtilities;
	}

	public void setRoomUtilities(Set<RoomUtility> roomUtilities) {
		this.roomUtilities = roomUtilities;
	}
	
	//bi-directional many-to-one association to District
	@OneToMany(mappedBy="room", fetch = FetchType.LAZY)
	public Set<Image> getImages() {
		return this.images;
	}

	public void setImages(Set<Image> images) {
		this.images = images;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="make_date")
	public Date getMakeDate() {
		return this.makeDate;
	}

	public void setMakeDate(Date makeDate) {
		this.makeDate = makeDate;
	}

	@Transient
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Transient
	public String getPriceRoomValue() {
		return priceRoomValue;
	}

	public void setPriceRoomValue(String priceRoomValue) {
		this.priceRoomValue = priceRoomValue;
	}

	@Transient
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Transient
	public String getHomeValue() {
		return homeValue;
	}

	public void setHomeValue(String homeValue) {
		this.homeValue = homeValue;
	}

	@Transient
	public String getGoogleMap() {
		return googleMap;
	}

	public void setGoogleMap(String googleMap) {
		this.googleMap = googleMap;
	}
}